﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="salepolicy.aspx.cs" Inherits="EZCRS.HCMS.Web.manage.hotel.salepolicy" %>

<%@ Register Src="../usercontrol/titlepage.ascx" TagName="titlepage" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link type="text/css" href="../../style/main.css" rel="Stylesheet" />

    <script src="../../Common/jquery-1.2.6.min.js"></script>

    <script src="../../Common/flexigrid/flexigrid.js"></script>

    <link rel="stylesheet" href="../../Common/flexigrid/flexigrid.css" type="text/css"
        media="screen" />
</head>
<body>

    <script type="text/javascript" charset="utf-8">

        $(document).ready(function() {

            $('#grid').flexigrid({
                //width: $(document).width() - 20,
                height: 350,
                //striped:false,
                url: '?action=get',
                dataType: 'json',
                colModel: [
                    { display: '<%= Resources.Site.LabCode %>', name: 'code', width: 100, sortable: false, align: 'center' },
                    { display: '<%= Resources.Site.LabName %>', name: 'name', width: 180, sortable: false, align: 'left' },
                    { display: '<%= Resources.Site.LabRemark %>', name: 'desc', width: 300, sortable: false, align: 'left' },
                    { display: '<%= Resources.Site.ScriptBasePrice %>', name: 'basis', width: 80, sortable: false, align: 'left' },
                    { display: '<%= Resources.Site.ScriptBaseUnit %>', name: 'cur', width: 80, sortable: false, align: 'left' },
                    { display: '<%= Resources.Site.LabStatus %>', name: 'state', width: 60, sortable: false, align: 'left' }
                ],
                singleSelect: true,
                buttons: [
                    { name: '<%= Resources.Site.ScriptAdd %>', bclass: "add", onpress: doCommand },
                    { name: '<%= Resources.Site.LabModify %>', bclass: "edit", onpress: doCommand },
                    { separator: true }
                ],
                showTableToggleBtn: true,
                rp: 15,
                usepager: true,
                useRp: true
            });

            $('#Radio1').click(function() {
                $('#grid').flexOptions({ query: '1' }).flexReload();
            });

            $('#Radio2').click(function() {
                $('#grid').flexOptions({ query: '0' }).flexReload();
            });
        });


        function doCommand(com, grid) {
            if (com == '<%= Resources.Site.LabModify %>') {
                if ($('.trSelected', grid)[0] == null) return;
                var rowid = $('.trSelected', grid)[0].id.replace(/row/, "");
                if (rowid != '')
                    window.location = 'salepolicy_add.aspx?id=' + rowid;
            }
            else if (com == '<%= Resources.Site.ScriptAdd %>') {
                window.location = 'salepolicy_add.aspx'
            }
        } 
    </script>

    <form id="form1" runat="server">
    <uc2:titlepage ID="Titlepage1" runat="server" inittitle="<%$ Resources:Site, TitleSalePolicy %>">
    </uc2:titlepage>
    <table cellpadding="0" cellspacing="0" class="main-table">
        <tr class="line-even">
            <td>
                <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            &nbsp;
                            <asp:Literal ID="Literal2" Text="<%$ Resources:Site, LabActive %>" runat="server"></asp:Literal>:<input
                                id="Radio1" type="radio" checked="checked" name="state" />
                            <asp:Literal ID="Literal1" Text="<%$ Resources:Site, LabNoActive %>" runat="server"></asp:Literal>:<input
                                id="Radio2" name="state" type="radio" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <br />
    </form>
    <table id="grid">
    </table>
    <div id="loadinfo" align="center">
    </div>
</body>
</html>
